package com.flc.gateway.server;

import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelFutureListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 发送成功与否的监听器
 * 发送不成功应该有相应的业务逻辑
 * @author haizi
 * @date 2018/1/25
 */
public class MyChannelFutureListener implements ChannelFutureListener {
    private static final Logger logger = LoggerFactory.getLogger(MyChannelFutureListener.class);

    @Override
    public void operationComplete(ChannelFuture future) throws Exception {
        if (future.isSuccess()) {
            logger.info("下发命令成功！");
        } else {
            logger.info("下发命令失败！");
        }
    }
}
